package com.ssm.platform.pojo.param;

import com.ssm.basis.model.pojo.param.BaseParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "UsersParam")
public class UsersParam extends BaseParam {
    private static final long serialVersionUID = 1L;

    @NotBlank
    @Schema(description = "登录用户名(非中文，唯一)")
    private String username;

    @Pattern(regexp = "^[a-zA-Z]\\w{5,17}$", message = "以字母开头，长度在 6-18 之间，只能包含字符、数字和下划线")
    @Schema(description = "密码")
    private String password;

    @Schema(description = "是否启用")
    private Boolean enabled;

    @Schema(description = "账户是否锁定")
    private Boolean accountNonLocked;

    @Schema(description = "账户是否启用")
    private Boolean accountNonExpired;

    @Schema(description = "凭证是否过期")
    private Boolean credentialsNonExpired;

    @Schema(description = "用户昵称")
    private String nickName;

    @Schema(description = "用户头像图片的 URL。URL 最后一个数值代表正方形头像大小（有 0、46、64、96、132 数值可选，0 代表 640x640 的正方形头像，46 表示 46x46 的正方形头像，剩余数值以此类推。默认132），用户没有头像时该项为空。若用户更换头像，原有头像 URL 将失效。")
    private String avatarUrl;

    @Min(1)
    @Max(150)
    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "性别，0-未知，1-男、2-女")
    private String gender;

    @Schema(description = "用户所在国家")
    private String country;

    @Schema(description = "用户所在省份")
    private String province;

    @Schema(description = "用户所在城市")
    private String city;

    @Schema(description = "语种，en-英文，zh_CN-简体中文，zh_TW-繁体中文")
    private String language;

    @Schema(description = "住址")
    private String address;

    @Min(0L)
    @Max(180L)
    @Schema(description = "住址经度")
    private BigDecimal addressLongitude;

    @Min(0L)
    @Max(90L)
    @Schema(description = "住址纬度")
    private BigDecimal addressLatitude;

    @Size(min = 15, max = 18)
    @Schema(description = "身份证号码")
    private String identityCardNo;

    @Schema(description = "区号")
    private String countryCode;

    @Schema(description = "用户绑定的手机号（国外手机号会有区号）")
    private String phoneNumber;

    @Size(max = 11)
    @Schema(description = "没有区号的手机号")
    private String purePhoneNumber;

    @Email
    @Schema(description = "邮箱地址")
    private String emailAddress;
}
